package com.site.springboot.core.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.util.Date;

/**
 * Project:springboot-project-news-publish-system
 * ClassName:NewsIndex
 * Package:com.site.springboot.core.entity
 * User:CWQ
 * Description:
 *
 * @Author 合肥-陈万琼
 * @Create 2024/5/28 23:56
 * @Version 1.0
 */
@Data
@Document(indexName = "news_index", createIndex = false)
public class NewsIndex {
    /*
     *新闻主键
     * */
    @Id
    @Field(name = "news_id")
    private Long newsId;
    /*
     *新闻标题
     * */
    @Field(type = FieldType.Keyword)
    private String newsTitle;
    /*
     *新闻类型
     * */
    @Field(type = FieldType.Long)
    private Long newsCategoryId;
    /*
     *新闻封面照片
     * */
    @Field(type = FieldType.Keyword)
    private String newsCoverImage;
    /*
     *新闻内容
     * */
    @Field(type = FieldType.Text,index = false,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String newsContent;
    /*
     *新闻发布状态
     * 0-发布 1-草稿
     * */
    @Field(type = FieldType.Byte)
    private Byte newsStatus;
    /*
     * 新闻浏览量
     * */
    @Field(type = FieldType.Long)
    private Long newsViews;
    /*
     * 是否已删除
     * 0-未删除 1-已删除
     * */
    @Field(type = FieldType.Byte)
    private Byte isDeleted;
    /*
     * 创建时间
     * */
    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second)
    private Date createTime;
    /*
     * 修改时间
     * */
    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second)
    private Date updateTime;
}
